<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>通过vue管表单元素：v-model，获取输入框的值以及设置输入框的值</p>
    <input type="text" v-model="val1">
    <p>您输入的值是：{{val1}}</p>
    <hr>
    <textarea v-model="val2"></textarea>
    <p>您输入的值是：{{val2}}</p>
    <hr>
    <span>性别:</span>
    <input type="radio" name="sex" value="1" v-model="val3">
    <label>男</label>
    <input type="radio" name="sex" value="2" v-model="val3">
    <label>女</label>
    <p>您的性别是：{{val3}}</p>
    <hr>
    <span>爱好:</span>
    <input type="checkbox" name="hobby" value="sing" v-model="val4">
    <label>唱</label>
    <input type="checkbox" name="hobby" value="dance" v-model="val4">
    <label>跳</label>
    <input type="checkbox" name="hobby" value="rap" v-model="val4">
    <label>rap</label>
    <input type="checkbox" name="hobby" value="basketball" v-model="val4">
    <label>打篮球</label>
    <p>您的爱好是：{{val4}}</p>
    <hr>
    <span>工作城市:</span>
    <select v-model="val5">
      <option value="hangzhou">杭州</option>
      <option value="shanghai">上海</option>
      <option value="shenzhen">深圳</option>
      <option value="beijing">北京</option>
    </select>
    <p>您的工作城市是：{{val5}}</p>
    <hr>
    <span>工作城市(多选):</span>
    <select v-model="val6" multiple>
      <option value="hangzhou">杭州</option>
      <option value="shanghai">上海</option>
      <option value="shenzhen">深圳</option>
      <option value="beijing">北京</option>
    </select>
    <p>您的工作城市是：{{val6}}</p>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        val1: '',
        val2: '',
        val3: '',
        val4: [],
        val5: '',
        val6: []
      }
    })
  </script>
</body>
</html>